

import 'package:flutter/cupertino.dart';
import 'package:gczn_hd/app/core/values/App_img.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import 'package:gczn_hd/app/core/values/app_colors.dart';
import 'package:gczn_hd/app/core/values/app_values.dart';
import 'package:gczn_hd/app/core/values/text_styles.dart';

class SopFileList extends StatelessWidget{


  @override
  Widget build(BuildContext context) {

    return Wrap(
      spacing: AppValues.size36, // 水平间距
      runSpacing: AppValues.size36, // 垂直间距
      children: [
        _buildFileItem(context),
        _buildFileItem(context),
        _buildFileItem(context),
        _buildFileItem(context),
        _buildFileItem(context),
      ],
    );

  }
  
  
  Widget _buildFileItem(BuildContext context){
    final Size imgSize = Size(96.w, 116.h);
    
    return GestureDetector(
      child: Container(
        width: (MediaQuery.of(context).size.width - 3 * AppValues.size36 - AppValues.size20) / 3, // 计算每个子项的宽度
        padding: EdgeInsets.only(left: AppValues.size28.w, right: AppValues.size28.w, top: AppValues.size20.w, bottom: AppValues.size20.w),
        decoration: BoxDecoration(
          border: Border.all(
            color: const Color.fromRGBO(39, 65, 80, 1),
            width: 1.0,
          ),
          borderRadius: BorderRadius.circular(AppValues.margin_12.r),
          color: AppColors.processBtn,
          boxShadow:  const [pressShadow],
        ),
        clipBehavior: Clip.hardEdge,
        child: Row(
          children: [
            SizedBox(
              child: Image.asset(AppImg.fileImg, width:imgSize.width, height:imgSize.height,),
            ),
            SizedBox(width: AppValues.size20.w,),
            Expanded(
              flex: 1,
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text("设备调机操作说明.pdf", style: textStyle30.copyWith(fontWeight: FontWeight.w700), maxLines: 2, overflow: TextOverflow.ellipsis,),
                  SizedBox(height: AppValues.size12.h,),
                  Text("上传人员：张三", style: textStyle20Opa8,),
                  Text("上传时间：2024-3-6 12:02", style: textStyle20Opa8,)
                ],
              ),
            )
          ],
        ),
      ),
    );
  }


}